﻿using System;
using System.Web.Services;
using Monkey.Warrenty.Biz;
using Monkey.Warrenty.EntityModel;

namespace MonkeyWarranty.Web.Dealers
{
    public partial class Groups : System.Web.UI.Page
    {
        #region Properties

        private static DealerGroupBiz _dealerGroupBiz;
        private static DealerGroupBiz DealerGroupManager
        {
            get { return _dealerGroupBiz ?? (_dealerGroupBiz = new DealerGroupBiz()); }
        }

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object GroupListWs()
        {
            //return DemoMethods.PersonList();
            //return null;
            //var groupBo = CustomerGroupManager.GetAllCustomerGroups();

            //return groupBo;
            return DealerGroupManager.GetAllDealerGroupsWs();
        }

        [WebMethod(EnableSession = true)]
        public static object CreateGroup(DealerGroup record)
        {
            //return DemoMethods.CreatePerson(record);
            //return null;
            return DealerGroupManager.CreateGroup(record);
        }

        [WebMethod(EnableSession = true)]
        public static object UpdateGroup(DealerGroup record)
        {
            //return DemoMethods.UpdatePerson(record);
            //return null;
            return DealerGroupManager.UpdateGroupWs(record);
        }

        [WebMethod(EnableSession = true)]
        public static object DeleteGroupWs(int Id)
        {
            return DealerGroupManager.DeleteGroupWs(Id);
            //return null;
        }
    }
}